package com.androidx.p013lv.invention.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.androidx.p013lv.base.Constance;
import com.androidx.p013lv.base.bean.InventionBean;
import com.androidx.p013lv.base.bean.VideoBean;
import com.androidx.p013lv.base.interfaces.Key;
import com.androidx.p013lv.base.listener.ItemClickListener;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.invention.C1069R;

/* renamed from: com.androidx.lv.invention.adapter.AdapterNewOne */
public class AdapterNewOne extends BaseRecyclerAdapter<InventionBean, Holder> {
    Context context;
    String domain;

    public AdapterNewOne(Context context2) {
        this.context = context2;
    }

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((InventionBean) this.list.get(i), i);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1069R.C1074layout.item_invention_seventen, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.invention.adapter.AdapterNewOne$Holder */
    public class Holder extends BaseRecyclerHolder {
        HorizonealAdapter adapter;
        LinearLayout btn_more;
        View itemView;
        RecyclerView recycler;
        TextView tv_title;

        public Holder(View view) {
            super(view);
            this.itemView = view;
            this.tv_title = (TextView) view.findViewById(C1069R.C1072id.tv_title);
            this.recycler = (RecyclerView) view.findViewById(C1069R.C1072id.recycler);
            this.btn_more = (LinearLayout) view.findViewById(C1069R.C1072id.btn_more);
        }

        public void setData(final InventionBean inventionBean, int i) {
            this.tv_title.setText(inventionBean.getStationName());
            this.btn_more.setOnClickListener(new View.OnClickListener() {
                /* class com.androidx.p013lv.invention.adapter.AdapterNewOne.Holder.View$OnClickListenerC11221 */

                public void onClick(View view) {
                    ARouter.getInstance().build(Constance.ONE_ACTIVITY).withString(Key.TXT, inventionBean.getStationName()).withInt("type", inventionBean.getStationId()).navigation();
                }
            });
            setRecycler(inventionBean);
        }

        /* access modifiers changed from: package-private */
        public void setRecycler(InventionBean inventionBean) {
            if (inventionBean.getVideoList() != null && inventionBean.getVideoList().size() != 0) {
                this.recycler.setLayoutManager(new LinearLayoutManager(AdapterNewOne.this.context, 0, false));
                HorizonealAdapter horizonealAdapter = new HorizonealAdapter(inventionBean.getVideoList(), AdapterNewOne.this.domain);
                this.adapter = horizonealAdapter;
                this.recycler.setAdapter(horizonealAdapter);
                this.adapter.setItemListener(new ItemClickListener() {
                    /* class com.androidx.p013lv.invention.adapter.AdapterNewOne.Holder.C11232 */

                    @Override // com.androidx.p013lv.base.listener.ItemClickListener
                    public void onItemClick(View view, int i) {
                        ARouter.getInstance().build(Constance.VIDEO_PLAY_ACTIVITY).withInt(Key.VIDEO_ID, ((VideoBean) Holder.this.adapter.getDataInPosition(i)).getVideoId()).navigation();
                    }
                });
            }
        }
    }
}
